var ajax = require('../../utils/ajax.js');
var common = require('../../utils/common.js');
var Base = require('../base.js');
var app = getApp();

var GoodsBuy = function({
  page,
  scope,
  cmpt
}) {
  Base.apply(this, arguments);
  this.init();
}

common.extend(GoodsBuy, Base);

Object.assign(GoodsBuy.prototype, {
  init() {
    var _self = this;
    var cmpt = this.curCmpt;
    var storeId = 0;

    try {
      storeId = cmpt.content.data.storeId;
    } catch (e) {}
    ajax.G('/openapi/CTechnician/technicianPage', {
      storeId
    }, function(res) {
      _self.setData({
        list: res.result
      });

    });
  },
});

GoodsBuy.props = {
  name: 'goodsBuy'
};

module.exports = GoodsBuy;